package com.lianniu.web.buyerProduct.service.impl;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lianniu.web.base.BaseResult;
import com.lianniu.web.buyerProduct.dao.IProductAssessDao;
import com.lianniu.web.buyerProduct.model.ProductAssessVo;
import com.lianniu.web.buyerProduct.service.IProductAssessService;
import com.lianniu.web.constants.ErrorCode;
@Service
public class ProductAssessServiceImpl implements IProductAssessService{
	
	public static final Logger LOGGER = Logger.getLogger(ProductAssessServiceImpl.class);
    @Autowired
    private IProductAssessDao productAssessDao;
	@Override
	@Transactional
	public BaseResult addProAssess(ProductAssessVo proAs) {
        LOGGER.info("ProductAssessServiceImpl addProAssess begin ");
        
        LOGGER.info("ProductAssessServiceImpl addProAssess end ");
        return BaseResult.success( productAssessDao.insertProAss(proAs));
    
	}
	@Override
	public BaseResult selectCommentById(String orderId) {
		 LOGGER.info("ProductAssessServiceImpl selectCommentById begin ");
		 List<String> list = null;
	        try {
	            list = productAssessDao.selectCommentById(orderId);
	        } catch (Exception e) {
	            LOGGER.info(ErrorCode.SQLExceptionRetInfo);
	            return BaseResult.exception(ErrorCode.SQLExceptionRetInfo);
	        }
	        LOGGER.info("ProductAssessServiceImpl selectCommentById end");
	        return BaseResult.success(list);
	}

	

}
